package net.citrite.android;

public class Position {
    private int start;
    private int end;
    private String label;

    public Position(int pos, String name) {
        end = pos;
        start = 0;
        label = name;
    }
    public int getEndPos() {
        return end;
    }

    public int getStartPos() {
        return start;
    }

    public void setStartPos(int i) {
        start = i;
    }



    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        Position o = (Position)obj;
        if (o.getEndPos() == this.getEndPos() && o.label.equals(this.label)) {
            return true;
        }
        return false;
    }

    @Override
    public String toString() {
        return String.format("label: %s, from %d to %d", label, start, end);
    }
}
